// import { ApiResponse } from '@/types/data'
import { ApiResponse, ArticleDetail } from '@/types/data'
import { RootThunkAction } from '@/types/store'
import request from '@/utils/request'

export const getArticleDetail = (id: string): RootThunkAction => {
  return async (dispatch) => {
    const res = await request.get<ApiResponse<ArticleDetail>>(`/articles/${id}`)
    console.log(res, 888)
    dispatch({
      type: 'articel/getArticleDetail',
      payload: res.data.data,
    })
  }
}
